/*
 * Copyright (C) 2009-2011 Knowings
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 3
 * as published by the Free Software Foundation.
 *

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
package com.knowings.tbs.trace;

import java.io.Serializable;
import java.util.List;

import com.knowings.tbs.persistence.IPersistent;

/**
 * The ITraceElement is the parent of both IObsel and IRelation.
 * 
 * @author privarola
 */
public interface ITraceElement extends IPersistent {

  /**
   * Method returning the name of the type of this trace element.
   * @return the name of the type of the element
   */
  public String getType();

  /**
   * Method returning all the attributes describing this trace element
   * @return a list of attributes
   */
  public List<IAttribute> getAttributes();

  /** Method returning the reference to the bearing trace.
   * @return an {@link ITrace} object.
   */
  public ITrace getTrace();

  /**
   * Tells whether or not this trace element contains an attribute with the given name.
   * @param name the name of an attribute
   * @return true if an attribute with this name is defined on this trace element
   */
  public boolean containsAttribute(String name);

  /**
   * Return the value of a specific attribute of this trace element. It may be a list of values if the 
   * ITBSKernel.OPTION_MULTIVALUED_PROPS_SUPPORTED descriptor is true on this trace repository.
   * @param name the name of an attribute
   * @return an attribute value or <tt>null</tt>
   */
  public Serializable getAttributeValue(String name);
}
